package com.zhang.common.core.page;

import lombok.Data;

/**
 * @Description
 * @Author zsw
 * @Date 2019/11/18 9:36
 * @Version V1.0
 **/
@Data
public class Pagination {

    private int pageSize = 10;
    private int pageNum = 1;
    /**
     * 排序字段
     */
    private String field;

    /**
     * 排序规则
     */
    private String sort;



    public Pagination(int pageSize, int pageNum) {
        this.pageSize = pageSize < 1 ? 10 : pageSize;
        this.pageNum = pageNum < 1 ? 1 : pageNum;
    }
    public Pagination(int pageSize, int pageNum, String field,String sort) {

        this.pageSize = pageSize < 1 ? 10 : pageSize;

        this.pageNum = pageNum < 1 ? 1 : pageNum;

        this.field = field;
        this.sort = sort;
    }
}